function print({ name, age, address: { province, city } } = {}) {
  console.log(name);
  console.log(age);
  console.log(province);
  console.log(city);
}

const user = {
  name: "zs",
  age: 12,
  address: {
    province: "四川",
    city: "成都",
  },
};

print(user);

function ajax({ method = "get", url } = {}) {
  console.log(method, url);
}

ajax({
  method: "get",
  url: "/abc",
});
// 注意传递undefined情况
ajax();
